<style type="text/css">
	#faqs dt, #faqs dd { padding: 0 0 0 30px }
	#faqs dt { font-size:14px; color: #555555; cursor: pointer; height: 37px; margin: 0 0 15px 0}
	#faqs dd { font-size: 13px; margin: 0 0 20px 0}
	#faqs dt { background: url(img/expand-icon.png) no-repeat top left}
	#faqs .expanded { background: url(img/expanded-icon.png) no-repeat top left}
</style>

<h4><i class="fa fa-question-circle"></i> <?php echo Yii::t('helpdesk','Frequently Asked Questions'); ?></h4><hr>
<form method="get" class="form-horizontal" action="/faqs.html">
<div class="form-group">
    <div class="col-sm-4">
    	<input type="text"  name="q" class="input-medium search-query" placeholder="<?php echo Yii::t('helpdesk','Keyword'); ?>" value="<?php echo !empty($keyword)?$keyword:null; ?>" >
    	<input type="submit" class="btn btn-success" style="height:26px; padding: 0 5px;" value="<?php echo Yii::t('helpdesk','Search'); ?>">
    </div>
</div>
</form>
<div class="content col-md-3">
    <div class="sidebar col-md-3">
        <?php if(!empty($arrFolders)): ?>
        <div class="section">
            <h4><?php echo Yii::t('helpdesk','Folders'); ?></h4>
            <ul class="folder">
                <?php foreach($arrFolders as $R): ?>                
                <li <?php if(isset($cateId) && $R['category_id'] == $cateId):?>class="active"<?php endif;?>>
                    <?php if($R['category_level'] > 0): for($i=0; $i<$R['category_level']; $i++): echo '&nbsp;&nbsp;&nbsp;&nbsp;'; endfor; endif; ?>
                    <a href="/faqs/<?php echo $R['category_id']; ?>.html">
                        <?php if(isset($cateId) && $R['category_id'] == $cateId):?><i class="fa fa-folder-open-o"></i><?php else: ?><i class="fa fa-folder-o"></i><?php endif;?>
                         <?php echo $R['category_name']; ?>
                    </a>
                </li>
                <?php endforeach; ?>
            </ul>
        </div>
        <?php endif; ?>
    </div>
	<div class="main-panel col-md-9">
    	<h5 style="background-color:#E9E9E9; height:30px; vertical-align:middle; padding:8px; margin-bottom:20px; font-weight:bold;">
			<a href="/documents.html" style="color:#317eac;"><?php echo Yii::t('helpdesk','FAQs'); ?></a> 
            <?php if(!empty($cate)): ?>
            &raquo; <?php echo $cate['category_name']; ?>
            <?php elseif(!empty($keyword)): ?>
            &raquo; <?php echo Yii::t('helpdesk','Search'); ?> "<?php echo trim($keyword, '%'); ?>"
            <?php else: ?>
            &raquo; <?php echo Yii::t('helpdesk','All'); ?>
            <?php endif; ?>
        </h5>
		<?php if(!empty($arrFaqs)): ?>
        <dl id="faqs">
            <?php foreach($arrFaqs as $R): ?>
            <dt><?php echo $R['post_title']; ?></dt>
            <dd><?php echo $R['post_body']; ?></dd>
            <?php endforeach; ?>
        </dl>
        <?php else: ?>
        <div><?php echo Yii::t('helpdesk','No data found'); ?></div>
        <?php endif; ?>
        <!--pagination-->
        <?php $this->widget('Pagination', array(
            'pages' => $objPages,
        )) ?>
    </div>
</div>
<script type="text/javascript">
    $("#faqs dd").hide();
    $("#faqs dt").click(function () {
        $(this).next("#faqs dd").slideToggle(500);
        $(this).toggleClass("expanded");
    });
</script>

